{extend name="layouts/base"}
{block name="header"}
<link rel="stylesheet" href="__STATIC__/pc/css/base_6.css">
<script src="__STATIC__/pc/js/html5_6.js"></script>
<script src="__STATIC__/pc/js/jquery_6.js"></script>
<script src="__STATIC__/pc/js/common_6.js"></script>
<link rel="stylesheet" href="__STATIC__/pc/css/problemlist.css">
<link rel="stylesheet" href="__STATIC__/pc/css/detail_1.css">
<style>
    .dis {
        background: transparent !important;
        color: #999 !important;
    }

    .dis:hover {
        box-shadow: none;
        transform: inherit;
    }
</style>
{/block}
{block name="main"}
<div class="top-img" style="background-color: #B0BEC5">
    <div class="w">
        <h1 class="tit">知识问答</h1>
        <img src="http://p3gu7x1ji.bkt.clouddn.com/%E9%98%BF%E9%87%8C%E6%97%BA%E6%97%BA%E5%9B%BE%E7%89%8720180905104608.jpg" alt="知识问答">
    </div>
</div>
<div class="w">
    <!-- 菜单 -->
    <div class="menus clear">
        <ul class="navs fl clear" id="p-tab">
            <?php
                foreach($qu as $k => $v){
            ?>
                <li class="<?php
                        if($k == 0){
                                echo 'on';
                        }
                ?>" data="{$k}">
                    <a title="{$v->name}">{$v->name}</a>
                </li>
            <?php
                }
            ?>
        </ul>
    </div>

    <?php
        foreach($qu as $k => $v){
    ?>
    <div class="main clear"  id="c_{$k}" style="display:<?php if($k !== 0){
                        echo 'none';
        }?>;">
        <div class="detailMain fl">
            <ul class="problem-list">
                <?php
                    foreach($v->questionitems as  $kk => $vv){
                 ?>
                    <li class="clear">
                    <div class="con fl">
                        <div class="tit">
                            <span class="label">Q</span>
                            <h2><a href="/index/question/qdesc?id={$vv->id}" title="{$vv->name}">{$vv->name}</a></h2>
                        </div>
                        <div class="des">
                            <a href="/index/question/qdesc?id={$vv->id}" title="{$vv->intro}">{$vv->intro}</a>
                        </div>
                        <div class="other">
                            <time>{:date('Y-m-d H:i:s',$vv->update_time)}</time>
                        </div>
                    </div>
                    <div class="img fr">
                        <a href="/index/question/qdesc?id={$vv->id}" title="{$vv->name}">
                            <?php if($vv->img !== '#' ){
                            ?>
                                <img src="{$vv->img}" alt="{$vv->name}">
                            <?php
                            }?>
                        </a>
                    </div>
                </li>
                <?php
                    }
                ?>
            </ul>
        </div>
    </div>
    <?php
        }
    ?>
</div>
{/block}

{block name="privateJs"}
<script>
    $(function () {

        //tab切换
        $('#p-tab>li').on('click', function () {
            var data = 'c_'+$(this).attr('data');
            $('.main').css('display','none');
            $('#'+data).css('display','block');
            $(this).addClass('on').siblings().removeClass('on');
            $('#p-tab-con>ul').hide().eq($(this).index()).show().find('li').removeClass('on').eq(0).addClass('on');
        })
    })
</script>

{/block}